<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
	<meta http-equiv="Cache-control" content="no-cache,no-store,must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<meta name="renderer" content="webkit">
	<title>Citcon Payment</title>
	<base href="{$sys.url}" />
	<link rel="stylesheet" type="text/css" href="{#css#}/artdialog.css" />
	<!-- if $config.favicon -->
	<link rel="shortcut icon" href="{$config.favicon}" />
	<!-- /if -->
	<script type="text/javascript" src="{url ctrl=js ext=jquery.artdialog/}" charset="utf-8"></script>
</head>
<body>
<div class="main" style="width:500px;margin:10px auto;">
	<div style="text-align:center;padding:10px;"><img src="api.php?f=qrcode&data={func rawurlencode $qrlink}" border="0" /></div>
	<div align="center"><a href="{if $session.user_id}{url ctrl=order func=info id=$rs.id/}{else}{url ctrl=order func=info sn=$rs.sn passwd=$rs.passwd/}{/if}" title="">返回详细页</a></div>
</div>
<script type="text/javascript">
function pending()
{
	var url = api_url('payment','query','sn={$order.sn}-{$order.id}');
	console.log(url);
	$.phpok.json(url,function(data){
		if(data.status && data.status != 'error'){
			url = get_url('payment','show','id={$order.id}');
			$.phpok.go(url);
		}else{
			window.setTimeout("pending()", 3000);
		}
	})
}
$(document).ready(function(){
	window.setTimeout("pending()", 5000);
});

//禁止后退
window.history.forward(1);   
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
    history.pushState(null, null, document.URL);
});
</script>
</body>
</html>